package com.fourinone.core;

import com.fourinone.base.ObjectVal;

/**
 * @Description 仓库
 * @auther Szper
 * @create 2019-10-18 15:43
 */
public class WareHouse extends ObjectVal {
    public final int NOTREADY = 1, READY = 0, EXCEPTION = -1;
    int status = READY;
    private boolean ready = true; // 就绪态
    private boolean mark = true; //记号
    public WareHouse() {
        super();
    }
    public WareHouse (boolean ready) {
        this();
        this.ready = ready;
        status = NOTREADY;
    }
    public WareHouse (Object k, Object v) {
        this();
        this.put(k, v);
    }
    public int getStatus () {
        return status;
    }

    public String getStatusName () {
        String[] statusName = new String[] {"EXCEPTION", "READY", "NOTREADY"};
        return statusName[status + 1];
    }
    public void setReday(int status) {
        this.ready = true;
        this.status = status;
    }
    public synchronized boolean isReady() {
        return ready;
    }
    public boolean isMark() {
        return mark;
    }

    public void setMark(boolean mark) {
        this.mark = mark;
    }
    public static void main (String[] args) {
        WareHouse wh = new WareHouse("key",new java.util.ArrayList());
        //wh.put("bbb",new Bean("",99,new java.util.ArrayList()));
        System.out.println(wh.get("key"));
    }
}

